package com.qijian.maindata.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;


/**
 * 数控(锯切)件工单对象 查询条件类
 *
 * @author qijian
 * @date 2021-11-30
 */

@Data
@ToString
@TableName("main_nc_order")
public class NcOrderQuery {

    @WhereType(filed = "order_id")
    private Long orderId;
    @WhereType(filed = "order_type")
    private String orderType;
    @WhereType(filed = "order_type", type = WhereTypeEnum.IN)
    private List<String> orderTypes;
    @WhereType(filed = "order_code", type = WhereTypeEnum.LIKE)
    private String orderCode;
    @WhereType(filed = "total_hours")
    private BigDecimal totalHours;
    @WhereType(filed = "total_wages")
    private BigDecimal totalWages;
    @WhereType(filed = "cutt_type")
    private String cuttType;
    @WhereType(filed = "cutt_length")
    private Long cuttLength;
    @WhereType(filed = "start_time")
    private Date startTime;
    @WhereType(filed = "end_time")
    private Date endTime;
    @WhereType(filed = "status")
    private Integer status;
    @WhereType(filed = "remark")
    private String remark;
    @WhereType(filed = "user_id")
    private Long userId;
    @WhereType(filed = "order_id", type = WhereTypeEnum.IN)
    private Set<Long> ids;

    @WhereType(filed = "business_origin_name",type = WhereTypeEnum.LIKE)
    private String businessOriginName;

    @WhereType(tableName = "main_project", filed = "project_no", type = WhereTypeEnum.LIKE)
    private String projectNo;
    @WhereType(tableName = "main_project", filed = "machine_no", type = WhereTypeEnum.LIKE)
    private String machineNo;
    @WhereType(tableName = "main_item", filed = "item_name")
    private String itemName;
    @WhereType(tableName = "main_item", filed = "item_attr", type = WhereTypeEnum.LIKE, func = "JSON_CONTAINS(item_attr, JSON_OBJECT('name', '厚', 'value', {1}))")
    private BigDecimal itemAttr;
    @WhereType(tableName = "main_item", filed = "drawing_no", type = WhereTypeEnum.LIKE)
    private String drawingNo;
    @WhereType(tableName = "main_item", filed = "part_no", type = WhereTypeEnum.LIKE)
    private String partNo;
    @WhereType(tableName = "main_nc_order", filed = "create_time", type = WhereTypeEnum.BETWEEN)
    private Date[] createTime;
    @WhereType(filed = "create_by", type = WhereTypeEnum.LIKE)
    private String createBy;
    @WhereType(filed = "nick_name", tableName = "u2", type = WhereTypeEnum.LIKE)
    private String orderManagerName;
    @WhereType(deptTableName = "u2", userTableName = "main_nc_order", filed = "create_id", orGroup = "status")
    private Boolean dataScope;

    @WhereType(filed = "status", orGroup = "status")
    private Integer statusAll;

    @WhereType(filed = "user_id", orGroup = "status")
    private Long selfUser;

    @WhereType(filed = "dict_label", tableName = "sys_dict_data", type = WhereTypeEnum.LIKE)
    private String statusName;

    @WhereType(filed = "order_code", type = WhereTypeEnum.IN)
    private List<String> orderCodeList;


    @WhereType(filed = "order_id", type = WhereTypeEnum.IN)
    private List<String> orderIdList;
}
